package cn.dnf.feignClient;

import cn.dnf.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

//指定此接口是feign客户端接口，括号中的值就是你要调用的客户端名称
@FeignClient(name = "user-server",fallbackFactory = UserFallbackFactory.class)
@RequestMapping("/user")
public interface UserFeignClient {
    /**
     * 代理接口事项
     * 1.方法名称一致
     * 2.参数一致
     * 3.请求方法一致
     * 4.直接CV你要代理的方法
     * @param id
     * @return
     */
    @GetMapping("/getById/{id}")
    User getById(@PathVariable("id")Long id);




}
